package cn.edu.tsinghua.training.cms.demo.service;

import java.io.Serializable;
import java.util.List;

import cn.edu.tsinghua.training.cms.demo.util.PageBean;

public interface GenericService<E extends Serializable, ID extends Serializable> {

	ID add(E e);
	
	List<E> query(String hql, String[] paramNames, Object[] values);
	
	List<E> queryAll();
	
	E queryById(ID id);
	
	void update(E e);
	
	void delete(E e);
	
	PageBean queryForPage(String hql, String[] params, Object[] values, int pageSize, int page);
	
}
